CONF_FILES =	config.h

SUBDIR +=	owfilter
SUBDIR +=	owlogcoll
SUBDIR +=	owlogmon

.include <bsd.subdir.mk>

.for t in cleanobj cleanlinks cleancmake
.	if target(_SUBDIRUSE)
$t: _SUBDIRUSE
.	elif target(_SUBDIR)
$t: _SUBDIR
.	else
# Emulate
$t:
.		for D in ${SUBDIR}
			(cd $D && ${MAKE} ${.TARGET})
.		endfor
.	endif
.endfor

########################################
# Configuration files
#

all lint: configure

configure: ${CONF_FILES}

${CONF_FILES}: ${.TARGET}.in
# Autodetecting of BSD parameters is built-in
	cp ${.TARGET}.in ${.TARGET}

cleandir: cleanconf cleancmake

cleanconf:
	rm -f ${CONF_FILES}

cleancmake: cleancmakeglobal

cleancmakeglobal:
	@echo '===> (global)'
	cd ${.CURDIR} && rm -f Makefile CMakeCache.txt cmake_install.cmake
	cd ${.CURDIR} && rm -Rf CMakeFiles
